// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import 'babel-polyfill'
require('es6-promise').polyfill()
// 引入字体图标
import './assets/font/iconfont.css'
// 引入路由
import router from './router'
// 引入vuex
import store from './vuex/store'
// axios.defaults.withCredentials=true
// 引入自定义公共组件
import Components from './components/index'
Vue.use(Components);
// 引入ElementUI公共组件
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
//引入公共api
import api from './fetch/api'
Vue.prototype.$api = api; 
// 引入ECharts图表公共组件
import echarts from 'echarts'
Vue.prototype.$echarts = echarts 
// 引入编辑器
import Tinymce from 'tinymce'
Vue.prototype.$tinymce = Tinymce; 


import VueCookies from 'vue-cookies'
Vue.use(VueCookies)

// set default config
VueCookies.config('7d')
// 设置生产模式/开发模式
Vue.config.productionTip = false;

router.beforeEach((to, from, next) => {
	/* 路由发生变化修改页面title */
	if (to.meta.title) {
		document.title = to.meta.title
	}
	next()
})
// window.router = router
/* eslint-disable no-new */
new Vue({
	el: '#app',
	store,
	router,
	api,
	components: {
		App
	},
	template: '<App/>'
})
